package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.query.*;
import org.jsola.hr.vo.*;
import org.jsola.hr.vo.excel.ChildCompanyExportVO;
import org.jsola.hr.vo.permission.RoleMemberVO;
import org.jsola.log.vo.ServiceLogListVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;

import javax.validation.Valid;
import java.util.List;

/**
 * @author ds
 */
@Api(tags = "首页统计页")
public interface IStatisticsPageControllerAPI {

    /**
     * 今日新增员工导出
     *
     * @param statisicsPageEmpExportQuery 导出参数
     * @return 文件
     */
    @ApiOperation(value = "今日新增员工导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "statisicsPageEmpExportQuery", dataType = "StatisicsPageEmpExportQuery", value = "员工导出参数", paramType = "body")
    })
    ResponseEntity<Resource> todayAddExport(@Valid StatisicsPageEmpExportQuery statisicsPageEmpExportQuery);

    /**
     * 企业总览用工概览顶部数量统计
     *
     * @param companyIds 公司Id
     * @return 数量统计信息
     */
    @ApiOperation(value = "查询统计概览数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyIds", dataType = "CompanyIdSQuery", value = "用工单位Id", paramType = "body")
    })
    Result<StatisticsPageVO> selectStatisticsCount(CompanyIdSQuery companyIds);

    Result<List<ChildCompanyExportVO>> listAll(@Valid ChildCompanyQuery childCompanyQuery);

    @ApiOperation(value = "导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyQuery", dataType = "CompanyQuery", value = "用工单位导出参数", paramType = "query")
    })
    ResponseEntity<Resource> exportComanyWithEmpCount(@Valid CompanyQuery companyQuery);

    /**
     * 企业总览,用工单位概览
     *
     * @param companyQuery 查询参数
     * @return 用工单位
     */
    @ApiOperation(value = "查询公司")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyQuery", dataType = "CompanyQuery", value = "公司查询参数", paramType = "query")
    })
    Result<Page<CompanyListVO>> listAll(@Valid CompanyQuery companyQuery);

    Result<Page<CompanyListVO>> listAllChildComanyWithAdmin(@Valid CompanyQuery companyQuery);

    @ApiOperation(value = "根据用人单位查询所有员工")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyQuery", dataType = "CompanyQuery", value = "查询公司员工参数", paramType = "body")
    })
    Result<Page<StatisticsEmpInfoVO>> selectAllStaff(@Valid EmpBySiteQuery empBySiteQuery);

    @ApiOperation(value = "导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyQuery", dataType = "ChildCompanyQuery", value = "子公司导出参数", paramType = "query")
    })
    ResponseEntity<Resource> export(@Valid ChildCompanyQuery childCompanyQuery);

    @ApiOperation(value = "查询员工，合同")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "empInfoQuery", dataType = "EmpInfoQuery", value = "员工查询参数", paramType = "query")
    })
    Result<Page<EmpContractInfoVO>> empContractInfoList(@Valid EmpInfoQuery empInfoQuery);

    Result<List<CompanyVO>> getSubCompany(@Valid ChildCompanyQuery childCompanyQuery);

    Result<List<RoleMemberVO>> getChildCompanyAdmin(@Valid ChildCompanyQuery childCompanyQuery);


    /**
     * 企业总览用工总览合同签约数
     * @param statisticsContractQuery 查询参数
     * @return 合同签约数
     */
    @ApiOperation(value = "电子合同查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "statisticsContractQuery", dataType = "StatisticsContractQuery", value = "电子合同查询参数", paramType = "body")
    })
    Result<List<StatisticsEmpInfoContractCountVO>> getStatisticsEmpInfoContractCount(StatisticsContractQuery statisticsContractQuery);

    /**
     * 学历占比
     *
     * @param companyIds 公司Ids
     * @return 学历占比
     */
    @ApiOperation(value = "学历占比")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyIds", dataType = "CompanyIdSQuery", value = "公司Ids", paramType = "body")
    })
    Result<EmpEduCountVO> empEduCount(CompanyIdSQuery companyIds);

    /**
     * 员工导出
     *
     * @param statisicsPageEmpExportQuery 导出参数
     * @return 文件
     */
    @ApiOperation(value = "员工导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "statisicsPageEmpExportQuery", dataType = "StatisicsPageEmpExportQuery", value = "员工导出参数", paramType = "body")
    })
    ResponseEntity<Resource> selectAllStaffExport(@Valid StatisicsPageEmpExportQuery statisicsPageEmpExportQuery);

    /**
     * 企业端首页,子公司,用工单位,员工数量统计
     *
     * @param companyIds 公司Id
     * @return 统计信息
     */
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyIds", dataType = "CompanyIdSQuery", value = "公司Id", paramType = "body")
    })
    @ApiOperation(value = "企业端首页,子公司,用工单位,员工数量统计")
    Result<StatisticsPageVO> selectCompanyAndEmpCountStatistics(CompanyIdSQuery companyIds);

    /**
     * 企业端首页社保统计
     *
     * @param companyIdSQuery    查询参数
     * @return 数量统计信息
     */
    @ApiOperation(value = "企业端首页社保统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyIdSQuery", dataType = "CompanyIdSQuery", value = "查询参数", paramType = "body")
    })
    Result<StatisticsPageVO> selectSocCount(CompanyIdSQuery companyIdSQuery);

    /**
     * 企业端首页员工操作日志
     *
     * @param serviceLogQuery 查询参数
     * @return 操作日志
     */
    @ApiOperation(value = "企业端首页员工操作日志")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "serviceLogQuery", dataType = "ServiceLogFillQuery", value = "查询参数", paramType = "body")
    })
    Result<Page<ServiceLogListVO>> selectServiceLog(ServiceLogFillQuery serviceLogQuery);

    /**
     * 企业端首页员工统计
     *
     * @param companyIdSQuery       查询参数
     * @return 操作日志
     */
    @ApiOperation(value = "企业端首页员工统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyIdSQuery", dataType = "CompanyIdSQuery", value = "查询参数", paramType = "body")
    })
    Result<StatisticsPageVO> selectHomeEmpCount(CompanyIdSQuery companyIdSQuery);

    /**
     * 修改租户logo
     *
     * @param picUrl 图片地址
     * @return 修改条数
     */
    @ApiOperation(value = "修改租户logo")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "picUrl", dataType = "String", value = "图片地址", paramType = "body")
    })
    Result<Integer> updateSitePic(String picUrl);

    /**
     * 查询公司分组
     *
     * @param childCompanyQuery 公司分组查询参数
     * @return page
     */
    @ApiOperation(value = "查询公司分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyQuery", dataType = "ChildCompanyQuery", value = "公司分组查询参数", paramType = "query")
    })
    Result<Page<ChildCompanyVO>> pageChildCompany(ChildCompanyQuery childCompanyQuery);

    /**
     * 导出公司分组
     *
     * @param childCompanyQuery 公司分组查询参数
     * @return excel
     */
    @ApiOperation(value = "导出公司分组")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "childCompanyQuery", dataType = "ChildCompanyQuery", value = "公司分组查询参数", paramType = "query")
    })
    ResponseEntity<Resource> exportChildCompany(ChildCompanyQuery childCompanyQuery);
}
